<template>
  <el-container class="index-con">
    <el-aside :class="showclass">
      <leftNav></leftNav>
    </el-aside>
    <el-container class="main-con">
      <el-header class="index-header" style="height: 50px">
        <NavMenu></NavMenu>
      </el-header>
      <el-main clss="index-main">
        <router-view></router-view>
      </el-main>
    </el-container>
  </el-container>
</template>

<script>
  import NavMenu from './common/NavMenu'
  import LeftNav from './common/leftnav'
  export default {
    name: 'Home',
    components: {NavMenu,LeftNav},
    data() {
      return {
        showclass: 'asideshow',
        showtype: false
      }
    },
    methods: {},
    created() {
      // 监听
      this.$root.Bus.$on('toggle', value => {
        if (value) {
          this.showclass = 'asideshow'
        } else {
          setTimeout(() => {
            this.showclass = 'aside'
          }, 300)
        }
      })
    },
  }

</script>

<style >
.index-con {
  height: 100%;
  width: 100%;
  box-sizing: border-box;
}

.aside {
  width: 64px !important;
  background-color: #334157;
  margin: 0px;
}
.asideshow {
  width: 240px !important;
  height: 100%;
  background-color: #334157;
  margin: 0px;
}
.index-header,
.index-main {
  padding: 0px;
}
</style>

